<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class RegisterRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules($request)
    {
        return [
            "username.required"=>"用户名不能为空",
            "username.max"=>"用户名长度太长",
            "email.required"=>"邮箱不能为空",
            "email.email"=>"邮箱格式错误",
            "email.unique"=>"邮箱已经被人注册",
            "password.required"=>"密码不能为空",
            "password.min"=>"密码最短不能少于8位",
        ];
    }
}
